package com.raisecom.test;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class ReentrantLockUnfairBeanchmarkDemo implements Counter {
	private volatile long count = 0;
	private Lock lock;
	
	public ReentrantLockUnfairBeanchmarkDemo() {
		lock = new ReentrantLock();
	}

	public long getValue() {
		return count;
	}

	public void increment() {
		lock.lock();
		try {
			count++;
		} catch (Exception e) {
			lock.unlock();
		}
	}

}
